// 派单收款商户票据明细
const {DataTypes, db } = require("../db");
db.define('receiptPd', {
id: {type: DataTypes.INTEGER, primaryKey: true, autoIncrement: true,comment:'表自增ID'},
tenantId:{type: DataTypes.INTEGER,allowNull:false,comment:''}, 
buId:{type: DataTypes.INTEGER,allowNull:false,comment:''}, 
billId:{type: DataTypes.INTEGER,allowNull:false,comment:'票号'}, 
billNo:{type: DataTypes.STRING(30),allowNull:false,comment:'待收票据票号'}, 
billDate:{type: DataTypes.STRING(10),allowNull:false,comment:'待收票据日期'}, 
buName:{type: DataTypes.STRING(255),allowNull:false,comment:'客户'}, 
transType:{type: DataTypes.INTEGER,allowNull:false,comment:''}, 
transTypeName:{type: DataTypes.STRING(255),allowNull:false,comment:'业务票据类型'}, 
leftAmount:{type: DataTypes.DECIMAL(18, 2),allowNull:false,defaultValue:0,comment:'应收余额'}, 
arrearsReal:{type: DataTypes.DECIMAL(18, 2),allowNull:false,defaultValue:0,comment:'应收'}, 
nowCheck:{type: DataTypes.DECIMAL(18, 2),defaultValue:0,comment:'本次收款'}, 
yhAmount:{type: DataTypes.DECIMAL(18, 2),defaultValue:0,comment:'收款优惠'}, 
salesId:{type: DataTypes.INTEGER,comment:''}, 
salesName:{type: DataTypes.STRING(255),comment:'业务员'}, 
doId:{type: DataTypes.INTEGER,comment:''}, 
doName:{type: DataTypes.STRING(255),comment:'经办人'}, 
state:{type: DataTypes.STRING(255),defaultValue:('收款中'),comment:'收款中|已收款'}, 
bak2:{type: DataTypes.STRING(255),comment:'收款账户金额明细'}, 
bak3:{type: DataTypes.STRING(255),comment:'收款账户'}, 
bak4:{type: DataTypes.STRING(255),comment:''}, 
cby:{type: DataTypes.INTEGER,comment:''}, 
cbyName:{type: DataTypes.STRING(255),comment:'派单 人'}, 
createdAt:{type: DataTypes.STRING(20),comment:'派单时间'}, 
doneAt:{type: DataTypes.STRING(20),comment:'收款确认时间'}, 
doneBy:{type: DataTypes.INTEGER,comment:'收款确认人'}, 
doneByName:{type: DataTypes.STRING(255),comment:''}, 

}, {
    tableName: 'receipt_pd',
    timestamps: false,
    comment: '派单收款商户票据明细',
    
});